// miniprogram/pages/poetry/oldbook/oldbook.js
const poetry_db = wx.cloud.database().collection("poetry")

Page({
  data: {
    oldbooks: []
  },
  onLoad: function (options) {
    poetry_db.where({
      title: "史书典籍"
    }).get({
      success: (res) => {
        console.log(res)
        var oldbooks = res.data[0].bookmarks
        this.setData({
          oldbooks: oldbooks
        })
      }
    })
  },
  onShareAppMessage: function () {

  },
  //书籍点击监听
  onBookClick(e) {
    console.log(e)
    var bookName = e.currentTarget.dataset.name
    console.log(bookName)
    wx.navigateTo({
      url: 'menu/menu?name=' + bookName
    })
  }
})